#ifndef LANGUAGE_VARS
#define LANGUAGE_VARS
#include "errors.hpp"
#include <sstream>
#include <string>
#include <vector>
using namespace std;

typedef enum Vartype {
	tNull,
	tFunction,
	tOpcode,
	tVarname,
	tNumeric,
	tString,
	tAlias,
	tInline,
	tArray,
	tReference,
	tError,
	tSpecial,
	tTypeID,
	tCustomType,
	tAliasWithArgc,
	tAliasWithTypeList,
	tAliasWithArgList,
	tUnknown
} Vartype;

class Variable {
private:
public:
	vector<Variable> arr;
	Vartype type;
	Variable(void);
	Variable(double d);
	Variable(string);
	~Variable();
	Variable*  makearr(int);
	Variable*  clear(void);
	void tell(void);
	string str;
	double i;
	Variable& operator=(const Variable& v) {
		this->str = v.str;
		this->i = v.i;
		this->type=v.type;
		this->arr = v.arr;
		return *this;
	}
	friend bool operator==(const Variable& a, const Variable& b)
	{
		if( (a.str==b.str) && (a.type==b.type) ) {
			return true;
		} else {
			return false;
		}
	}
	friend bool operator!=(const Variable& a, const Variable& b)
	{
		return !(a==b);
	}
};

bool isSettingOpcode(string);
bool isopcode(string);
bool isopcode(char);
bool isalpha(char);
bool isDecNumeric(char, bool=true);
bool isHexNumeric(char, bool=true);
bool isOctNumeric(char, bool=true);
bool isBinNumeric(char, bool=true);
bool islegalvarname(char);
bool islegalvarnamestarter(char);
bool isspecialchar(char);
bool isalphanumeric(char c, bool space=false);
bool checkconditional(double,string,double);
bool checkconditional(string,string,string);
string vartypeToStr(Vartype);
// This means "trim LE (leading/ending) whitespace"
string trim_le_whitespace(string);
#endif
